﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Omu.Awesome.Mvc;

namespace Icms.WebUI.Dto
{
    public class RegistrationInput : Input
    {
        [Req]
        [Display(Name="Titlu")]
        public string Title { get; set; }
    }

    public class CaseInput : Input
    {
        [Req]
        [UIHint("Textarea")]
        [Display(Name="Esenta cauzei")]
        public string Nature { get; set; }

        [Req]
        [Display(Name="Data inregistrarii")]
        public DateTime? CreatedDate { get; set; }

        [Req]
        public Guid? TypeId { get; set; }

        [Req]
        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "ParameterCaseKindAjaxDropdown", ParentId = "TypeId")]
        [AwesomeParameters("{code:'TypeExam', reqCourt: true}")]
        [Display(Name = "Procedura examinarii")]
        public Guid? TypeExamId { get; set; }
        
        [Req]
        [UIHint("AjaxDropdown")]
        [AjaxDropdown(Controller = "ParameterAjaxDropdown", ParentId = "TypeExamId")]
        [Display(Name="Indicile dosarului")]
        public Guid? IndexId { get; set; }

        [Req]
        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'TypeInitialisation'}")]
        [AjaxDropdown(Controller = "ParameterCaseKindAjaxDropdown", ParentId = "TypeId")]
        [Display(Name="Procedura initierii")]
        public Guid? TypeInitialisationId { get; set; }
       
        [Display(Name="Numarul revizuit")]
        public string RevisedNumber { get; set; }
        [Display(Name="Titlul revizuit")]
        public string RevisedTitle { get; set; }

        [Display(Name="Dosar referinta")]
        public string Reference { get; set; }
        
        [Display(Name="Date confidentiale")]
        public bool IsSecret { get; set; }

        [Req]
        [UIHint("Lookup")]
        [Lookup(Paging = true,ClearButton = true,Fullscreen = true)]
        [Display(Name="Categoria dosarului")]
        public Guid? MainCaseTypeId { get; set; }

        [UIHint("Wy")]
        [Display(Name="Comentarii")]
        public string Comments { get; set; }
        
        [Req]
        [Display(Name="Volume")]
        public int? Volumes { get; set; }
        
        [UIHint("Textarea")]
        [Display(Name="Anexe")]
        public string Annex { get; set; }

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'CrimeEnvironment'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Mediul savarsirii infractiunii")]
        public Guid? CrimeEnvironmentId { get; set; }

        [Display(Name = "Numărul atribuit de organul de urmărire penală")]
        public string ProsecutorNumber { get; set; }
        
        [Display(Name="Acord de recunoastere a vinovatiei")]
        public bool HasPleaBargaining { get; set; }
        
        [Display(Name="Taxa de stat")]
        public decimal StateFee { get; set; }

        [UIHint("lookup")]
        [Lookup(Multiselect = true,Paging = true,Fullscreen = true)]
        [Display(Name="Tipuri de cazuri")]
        public IEnumerable<Guid> CaseTypes { get; set; }
    }

    public class ParticipantEditInput: Input
    {
        [Display(Name="Persoana")]
        [UIHint("Lookup")]
        public Guid? PersonId { get; set; } // lookup persons
        
        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'typeofparty', reqCourt: true}")]
        [AjaxDropdown(Controller = "ParameterCaseKindAjaxDropdown", ParentId = "CurrentCaseTypeId")]
        [Req]
        [Display(Name="Participant")]
        public Guid? TypePartyId { get; set; }// reclamant parat parameter code='typeofparty', data=requirescourt, caseKind 

        [UIHint("Textarea")]
        [Display(Name="Comentarii")]
        public string Comments { get; set; }

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'Region'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Raion")]
        public Guid? RegionId { get; set; }// parameter code = region

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'Education'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Studii")]
        public Guid? EducationId { get; set; }//parameter code =Education

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'Occupation'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Locul de munca")]
        public Guid? OccupationId { get; set; }//Occupation

        [Display(Name="Acord de recunoastere a vinovatiei")]
        public bool PleaBargain { get; set; }


        public bool Minor { get; set; }

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'Citizenship'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Cetatenie")]
        public Guid? CitizenshipId { get; set; }//Citizenship

        [UIHint("AjaxDropdown")]
        [AwesomeParameters("{code:'Cat'}")]
        [AjaxDropdown(Controller = "ParameterByCodeAjaxDropdown")]
        [Display(Name="Categoria")]
        public Guid? CatId { get; set; }//cat

        [Display(Name="Raion")]
        public string Region { get; set; }

        public string TypeActivity { get; set; }
        
        [Display(Name = "Functia")]
        public string Function { get; set; }

        [Display(Name = "Nume")]
        public string LastName { get; set; }
        
        [Display(Name = "Prenume")]
        public string FirstName { get; set; }

        [Display(Name = "Patronimic")]
        public string SurName { get; set; }
        
        [StringLength(13)]
        public string Idnp { get; set; }
        
        [Req]
        [UIHint("AjaxDropdown")]
        public string Type { get; set; }
        
        [Req]
        [UIHint("AjaxDropdown")]
        [Display(Name = "Sex")]
        public string Gender { get; set; }

        [Display(Name = "Localitatea")]
        public string Location { get; set; }
        
        [Display(Name = "Strada")]
        public string Street { get; set; }

        [Display(Name = "Casa")]
        public string Home { get; set; }

        [Display(Name = "Apartament")]
        public string Appartment { get; set; }

        [Display(Name = "Telefon")]
        public string Phone { get; set; }

        [Display(Name = "Mobil")]
        public string CellPhone { get; set; }

        public string Email { get; set; }

        [Display(Name = "Informatii de contact")]
        public string ContactInfo { get; set; }

        [Display(Name = "Data nasterii")]
        public DateTime? DateOfBirth { get; set; }

        [Display(Name = "Strain")]
        public bool Stranger { get { return RegionId.HasValue; } }
    }

    public class ParticipantCreateInput : ParticipantEditInput
    {
        [Req]
        public Guid CaseId { get; set; } // hidden
    }
}
